/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */

//require('./bootstrap');
//注释的这个引入已经不行了  新写的这个才可以
// window.Vue = require('vue');

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
import Vue from 'vue'
import App from './App.vue'
import router from './router'
// 引入自定义插件
import util from './util/util'
import Axiox from 'axios'
import {
    Pagination,
    Dialog,
    Dropdown,
    DropdownMenu,
    DropdownItem,
    Input,
    Radio,
    Checkbox,
    CheckboxGroup,
    Switch,
    Select,
    Option,
    Button,
    Table,
    TableColumn,
    DatePicker,
    TimeSelect,
    TimePicker,
    Tooltip,
    Form,
    FormItem,
    Tabs,
    TabPane,
    Tree,
    Icon,
    Upload,
    Rate,
    Loading,
    MessageBox,
    RadioGroup,
    Message,
    Col,
    Notification
} from 'element-ui'
// 按需加载
Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
Vue.use(DropdownItem)
Vue.use(Input)
Vue.use(Radio)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(Switch)
Vue.use(Select)
Vue.use(Option)
Vue.use(Button)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(DatePicker)
Vue.use(TimeSelect)
Vue.use(TimePicker)
Vue.use(Tooltip)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Tree)
Vue.use(Icon)
Vue.use(Rate)
Vue.use(Loading)
Vue.use(Upload)
Vue.use(RadioGroup)
Vue.use(Col)
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox
Vue.prototype.$notify = Notification
Vue.use(util)
// 初始化网络请求组件(开启跨域请求)
Axiox.defaults.withCredentials = true
Axiox.create({
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    }
})
window.axiox = Axiox

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

//Vue.component('example', require('./components/Example.vue'));

const app = new Vue({
    el: '#app',
    router,
    render: h => h(App),
});
